#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import repairinfo_blueprint
from api_1_0.repairInfoResource.repairInfoResource import RepairInfoResource
from api_1_0.repairInfoResource.repairInfoOtherResource import RepairInfoOtherResource

api = Api(repairinfo_blueprint)

api.add_resource(RepairInfoResource, '/repairInfo/<repairID>', '/repairInfo', endpoint='repairInfo')


# 首页列表路由
@repairinfo_blueprint.route('/repairInfo/index', methods=['POST'], endpoint="Index")
def index():
    return RepairInfoOtherResource.index()


@repairinfo_blueprint.route('/repairInfo/myIndex', methods=['POST'], endpoint="MyIndex")
def register():
    return RepairInfoOtherResource.myIndex()


@repairinfo_blueprint.route('/repairInfo/submit_info', methods=['POST'], endpoint="SubmitInfo")
def submit_info():
    return RepairInfoOtherResource.submit_repair_info()


@repairinfo_blueprint.route('/repairInfo/getRepairDetail', methods=['GET'], endpoint="getRepairDetail")
def submit_info():
    return RepairInfoOtherResource.get_repair_detail()


@repairinfo_blueprint.route('/repairInfo/getArrangementInfo', methods=['GET'], endpoint="getArrangementInfo")
def arrangementInfo():
    return RepairInfoOtherResource.get_arrangementInfo()


@repairinfo_blueprint.route('/repairInfo/arrangeWorker', methods=['POST'], endpoint="arrangeWorker")
def arrangeWorker():
    return RepairInfoOtherResource.arrangeWorker()


@repairinfo_blueprint.route('/repairInfo/finishRepair', methods=['POST'], endpoint="finishRepair")
def finishRepair():
    return RepairInfoOtherResource.finishRepair()

@repairinfo_blueprint.route('/repairInfo/fuzzySearch', methods=['GET'], endpoint="FuzzySearch")
def fuzzySearch():
    return RepairInfoOtherResource.get_searchInfos()
